//
//  DbUtil.h
//  Chat
//
//  Created by 任伟 on 16/3/8.
//  Copyright © 2016年 任伟. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDB.h"

@interface DbUtil : NSObject {

    FMDatabaseQueue *dbQueue;
}

@property (nonatomic, strong) FMDatabase *db;

+ (DbUtil *)sharedDatabase;

- (id)init;

- (id)initWithQueue;

- (void)executeQuery:(NSString *)sql results:(NSMutableArray *)results;

- (void)executeQuery:(NSString *)tablename columnlist:(NSArray *)columnlist conditionmap:(NSDictionary *)conditionmap results:(NSMutableArray *)results;

- (BOOL)execUpdate:(NSString *)sql;

- (BOOL) executeUpdate:(NSString *)tablename valuemap:(NSDictionary *)value_map conditionmap:(NSDictionary *)condition_map;

- (BOOL)executeInsert:(NSString *)tablename valuemap:(NSDictionary *)value_map;

- (BOOL)executeDelete:(NSString *)tablename conditionmap:(NSDictionary *)condition_map;

@end
